<html>
<head>
<g:javascript>
		function clearPost(e) {
			$('taskContent').value='';
		}
</g:javascript>

</head>
<body>
<div class="page_margins">
	<div id="topnav">
		Welcome ${session.user.userId }
		-
		<a href="users/${session.user.userId}/stats">Stats</a> -
		<g:link controller="user" action="logout">logout</g:link>
	</div>
	<div class="page">
		<div id="main">
			<div id="col1">
				<div id="col1_content" class="clearfix">
					<g:render template="/todo/sortMenu"
							model="[sortMenuItemSelected : sortMenuItemSelected]" />
				</div>
			</div>
			<div id="col3">
				<div id="col3_content" class="clearfix">
					<g:render template="/common/flash" model="[flash:$flash]" />
					<div id="task-manager">
						<g:form method="post">
							<div class="dialog">
								<table>
									<tbody>
										<tr class="prop">
											<td valign="top" class="value"><g:textArea
													id="taskContent" name="newTask" /></td>
											<td><g:submitToRemote value="Add"
													url="[controller: 'todo', action: 'addAjax']"
													update="allTasksList" onSuccess="clearPost(e)" /></td>
										</tr>
									</tbody>
								</table>
							</div>
						</g:form>
					</div>
					<div id="allTasksList" class="task-list">
						<g:render template="/todo/tasksList"
							model="[statusHistoryList: statusHistoryList, tasksCount:tasksCount]" />
					</div>			
				</div>
				<!-- IE Column Clearing -->
				<div id="ie_clearing">&#160;</div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>
